package com.taobao.api.request;

import java.util.Date;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.TmallEaiOrderRefundGoodReturnMgetResponse;

/**
 * TOP API: tmall.eai.order.refund.good.return.mget request
 * 
 * @author auto create
 * @since 1.0, 2013-08-03 16:51:00
 */
public class TmallEaiOrderRefundGoodReturnMgetRequest implements TaobaoRequest<TmallEaiOrderRefundGoodReturnMgetResponse> {

  private Map<String, String> headerMap = new TaobaoHashMap();
  private TaobaoHashMap       udfParams;                      // add
                                                              // user-defined
                                                              // text parameters
  private Long                timestamp;

  /**
   * 批量查询结束时间
   */
  private Date                endTime;

  /**
   * 页码。取值范围:大于零的整数; 默认值:1
   */
  private Long                pageNo;

  /**
   * 每页条数。取值范围:大于零的整数; 默认值:40;最大值:100
   */
  private Long                pageSize;

  /**
   * 批量查询开始时间
   */
  private Date                startTime;

  /**
   * 退货单 退款单状态
   */
  private String              status;

  /**
   * 是否启用has_next的分页方式，如果指定true,则返回的结果中不包含总记录数，但是会新增一个是否存在下一页的的字段，通过此种方式获取增量退款
   * ，接口调用成功率在原有的基础上有所提升。
   */
  private Boolean             useHasNext;

  public void setEndTime(Date endTime) {
    this.endTime = endTime;
  }

  public Date getEndTime() {
    return this.endTime;
  }

  public void setPageNo(Long pageNo) {
    this.pageNo = pageNo;
  }

  public Long getPageNo() {
    return this.pageNo;
  }

  public void setPageSize(Long pageSize) {
    this.pageSize = pageSize;
  }

  public Long getPageSize() {
    return this.pageSize;
  }

  public void setStartTime(Date startTime) {
    this.startTime = startTime;
  }

  public Date getStartTime() {
    return this.startTime;
  }

  public void setStatus(String status) {
    this.status = status;
  }

  public String getStatus() {
    return this.status;
  }

  public void setUseHasNext(Boolean useHasNext) {
    this.useHasNext = useHasNext;
  }

  public Boolean getUseHasNext() {
    return this.useHasNext;
  }

  public Long getTimestamp() {
    return this.timestamp;
  }

  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }

  public String getApiMethodName() {
    return "tmall.eai.order.refund.good.return.mget";
  }

  public Map<String, String> getTextParams() {
    TaobaoHashMap txtParams = new TaobaoHashMap();
    txtParams.put("end_time", this.endTime);
    txtParams.put("page_no", this.pageNo);
    txtParams.put("page_size", this.pageSize);
    txtParams.put("start_time", this.startTime);
    txtParams.put("status", this.status);
    txtParams.put("use_has_next", this.useHasNext);
    if (this.udfParams != null) {
      txtParams.putAll(this.udfParams);
    }
    return txtParams;
  }

  public void putOtherTextParam(String key, String value) {
    if (this.udfParams == null) {
      this.udfParams = new TaobaoHashMap();
    }
    this.udfParams.put(key, value);
  }

  public Class<TmallEaiOrderRefundGoodReturnMgetResponse> getResponseClass() {
    return TmallEaiOrderRefundGoodReturnMgetResponse.class;
  }

  public void check() throws ApiRuleException {
    RequestCheckUtils.checkNotEmpty(endTime, "endTime");
    RequestCheckUtils.checkMinValue(pageNo, 1L, "pageNo");
    RequestCheckUtils.checkMaxValue(pageSize, 100L, "pageSize");
    RequestCheckUtils.checkMinValue(pageSize, 1L, "pageSize");
    RequestCheckUtils.checkNotEmpty(startTime, "startTime");
  }

  public Map<String, String> getHeaderMap() {
    return headerMap;
  }
}
